package com.sprucetec.live.enums;

/**
 * User: chenwei11
 * Date: 2019/8/29
 * Time: 15:51
 * Description: 数据状态枚举
 **/
public enum DeleteStatusEnum {

    VALID(0,"有效"),
    DELETED(1,"删除");

    private Integer code;

    private String desc;

    DeleteStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String code2Desc(Integer code) {
        for (DeleteStatusEnum status : DeleteStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
